package com.zh.business.config.mq;

import com.zh.zhbootcommon.domain.NotifyMsgSendVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 描述: Mq生产者
 *
 * @author: yanglin
 * @Date: 2021-11-16-16:34
 * @Version: 1.0
 */
@Slf4j
@Component
public class NotifyMsgProducer {

    @Resource
    private RabbitTemplate rabbitTemplate;


    public void send(NotifyMsgSendVO notifyMsgSendVO) {
        log.debug("生产消息【{}】", notifyMsgSendVO);
        this.rabbitTemplate.convertAndSend("zh-mq-notify",
                "zh-mq-routing", notifyMsgSendVO);
    }
}
